<?php
include_once ('head.php');

?>
<div class="container">
	<div class="layui-card">
		<div class="layui-card-header">系统设置</div>
		<div class="layui-card-body">
			<form class="layui-form layui-form-pane" action=""><input type="hidden" name="my" value="set">
				<div class="layui-form-item">
					<label class="layui-form-label" title="Logo标题">Logo标题</label>
					<div class="layui-input-block">
						<input type="text" name="logobt" autocomplete="off" value="<?=$conf['logobt']?>" placeholder="Logo标题" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" title="网站标题">网站标题</label>
					<div class="layui-input-block">
						<input type="text" name="name" autocomplete="off" value="<?=$conf['name']?>" placeholder="网站标题" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" title="站长QQ号码">站长QQ号码</label>
					<div class="layui-input-block">
						<input type="text" name="kfqq" autocomplete="off" value="<?=$conf['kfqq']?>" placeholder="站长QQ号码" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" title="加群链接">加群链接</label>
					<div class="layui-input-block">
						<input type="text" name="qlurl" autocomplete="off" value="<?=$conf['qlurl']?>" placeholder="社区交流群链接" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" title="频繁检查(需Redis3.0扩展)">频繁检查(需Redis3.0扩展)</label>
					<div class="layui-input-block">
						<select name="check" lay-filter="aihao">
							<option value="<?=$conf['check']?>" selected=""><?php if($conf['check']==1) echo '开启'; else echo '关闭'; ?></option>
							<option value="1">开启</option>
							<option value="0">关闭</option>
						</select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" title="请求频率">请求频率</label>
					<div class="layui-input-block">
						<input type="text" name="check_time" autocomplete="off" value="<?=$conf['check_time']?>" placeholder="请求频率(秒)" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" title="注册验证码">注册验证码</label>
					<div class="layui-input-block">
						<select name="regcode" lay-filter="aihao">
							<option value="<?=$conf['regcode']?>" selected=""><?php if($conf['regcode']==1) echo '开启'; else echo '关闭'; ?></option>
							<option value="1">开启</option>
							<option value="0">关闭</option>
						</select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" title="后台登录验证码">后台登录验证码</label>
					<div class="layui-input-block">
						<select name="activecode" lay-filter="aihao">
							<option value="<?=$conf['activecode']?>" selected=""><?php if($conf['activecode']==1) echo '开启'; else echo '关闭'; ?></option>
							<option value="1">开启</option>
							<option value="0">关闭</option>
						</select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" title="用户登录验证码">用户登录验证码</label>
					<div class="layui-input-block">
						<select name="logincode" lay-filter="aihao">
							<option value="<?=$conf['logincode']?>" selected=""><?php if($conf['logincode']==1) echo '开启'; else echo '关闭'; ?></option>
							<option value="1">开启</option>
							<option value="0">关闭</option>
						</select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" title="单IP限制注册数">单IP限制注册数</label>
					<div class="layui-input-block">
						<input type="text" name="reglimit" autocomplete="off" value="<?=$conf['reglimit']?>" placeholder="单IP限制注册数(个)" class="layui-input">
					</div>
				</div>
				
				<div class="layui-form layui-form-pane">
					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label" title="站长统计">站长统计</label>
						<div class="layui-input-block">
							<textarea name="cnzz" placeholder="请输入站长统计代码" class="layui-textarea"><?=$conf['cnzz']?></textarea>
						</div>
					</div>
				</div>
				
				<button type="button" class="layui-btn layui-btn-fluid" lay-filter="set" lay-submit>更 改</button>
			</form>
		</div>
	</div>
</div>
	<script src="../layui/layui.all.js"></script>
	<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
	<!--您的Layui代码start-->
	<script type="text/javascript">
		const {$,form,layer} = layui;
		form.on('submit(set)', function(setdata){
			var index = layer.load(1, {
				shade: [0.6, '#000']
			});
			$.ajax({
				type: "post",   
				url:  "Ajax.php", 
				data: setdata.field,
				dataType: "json",
				success: function (res) {
					layer.close(index);
					if(res.code==1){
						layer.msg(res.msg,{icon: 6});
						history.go(0);
					}else if(res.code==0){
						layer.msg(res.msg,{icon: 5});
					}
				},
				error: function (res) {
					layer.msg('请求失败',{icon: 5});
					layer.close(index);
				}   
			});
		})
	</script>
</body>
</html>

